class CreamFactory {
  CreamDelivery() {
    console.log('奶油工厂配送奶油')
  }

  CreamReport() {
    console.log('奶油工厂汇报工作')
  }
}

class HoneyFactory {
  HoneyDelivery() {
    console.log('蜂蜜工厂配送奶油')
  }

  HoneyReport() {
    console.log('蜂蜜工厂汇报工作')
  }
}

// 外光模式 - 办事处
class FactoryFacade {
  creamFactory: CreamFactory
  honeyFactory: HoneyFactory

  // 创建工厂
  constructor() {
    this.creamFactory = new CreamFactory()
    this.honeyFactory = new HoneyFactory()
  }

  // 管理工厂
  FactoryDelivery() {
    this.creamFactory.CreamDelivery()
    this.honeyFactory.HoneyDelivery()
  }

  // 汇报工作
  FactoryReport() {
    this.creamFactory.CreamReport()
    this.honeyFactory.HoneyReport()
  }
}

(function () {
  let factoryFacade = new FactoryFacade()
  factoryFacade.FactoryDelivery()
  factoryFacade.FactoryReport()
}())